package de.tabuma.soapforms.soapproject.controller;

import de.tabuma.soapforms.*;
import de.tabuma.soapforms.soapproject.entity.*;
import de.tabuma.soapforms.soapproject.logik.*;
import de.tabuma.lib.tabumacontroller;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.google.appengine.api.users.*;
import de.tabuma.customer.entity.*;
import de.tabuma.customer.logik.*;

/**
 *
 * @author alefen
 */
public class list extends tabumacontroller {

    public list(String servlet, Hashtable parameter) {
        super(servlet, parameter);
    }

    @Override
    public void navigate(ServletContext context, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {

        List<Customer> cList = (List<Customer>) request.getAttribute(constants.customerList);

        List<SoapProject> spList = new ArrayList<SoapProject>();
        for(int i=0;i<cList.size();i++) {
            spList.addAll(SoapProjectFacade.getList(cList.get(i).getId().intValue()));
        }
        request.setAttribute(constants.soapProjectList, spList);
        request.setAttribute(constants.showCustomerList, "true");
    }
}
